package org.onionframework.persistence.dao.processor;


import org.hibernate.criterion.Criterion;
import org.hibernate.criterion.MatchMode;
import org.onionframework.persistence.dao.CriteriaBuilder;
import org.onionframework.persistence.dao.PropertyFilterProcessor;
import org.onionframework.persistence.dao.expression.OnionExpressions;

public class LikeProcessor implements PropertyFilterProcessor {

	@Override
	public Criterion buildCriterion(String alias, String name, Object value,
			CriteriaBuilder context) {
		return OnionExpressions.like(alias, (String) value,
				MatchMode.ANYWHERE);
	}

}
